﻿using CC.Extending;
using CC.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Demo
{
    public partial class SliderGroupDemo : Form
    {
        public SliderGroupDemo()
        {
            InitializeComponent();
           
        }

        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            sliderGroup1.ResetToSliders((int)numericUpDown1.Value);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CcSliderNoRowTitle slider = new CcSliderNoRowTitle(txtName.Text, 0, (double)numMax.Value, (double)numMin.Value, (double)numStep.Value);
            if (chkClearBeforeAdd.Checked) sliderGroup1.ClearSliders();
            sliderGroup1.AddSlider(slider);
            
        }

        private void btnGetValues_Click(object sender, EventArgs e)
        {
            txtValues.Text = sliderGroup1.Values.ToCommaString();
        }

        private void sliderGroup1_Enter(object sender, EventArgs e)
        {
            
        }
        private void sliderGroup1_ValueChanged(object sender, EventArgs e)
        {
           
        }
        private void sliderGroup1_Click(object sender, EventArgs e)
        {
            
        }

        private void sliderGroup1_OnValueChanged(object sender, ValueChangedEventArgs e)
        {
            txtCurrentSld.Text = e.CurrentSlider.Name;
        }
    }
}
